package connection;

import java.sql.SQLException;

public class ConnectionDAO {
	ConnecPool g= ConnecPool.getInstance();	
	public ConnectionDAO(){
	
	}
	public JDCConnection getConnection() throws SQLException{
		JDCConnection connection = g.getConnection();
		connection.setAutoCommit(false);
		return connection; 
	}

	
	
	public void closeConnection(){
	//close ou retourne dans le pool
	try {
		((JDCConnection)g.getConnection()).close();
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	System.out.println("CLOSE Connection ");
	}
}
